<template>
  <main class="xh-main">
    <section>
      <img class="full-width" src="/static/bg03.png" alt="">
    </section>
    <section class="main-about pc-width">
      <!-- <ac-menu></ac-menu>
      <div class="ac-content">
        <router-view></router-view>
      </div> -->
      <section class="section-2 relative content-width">
      <div class="flex-justycontent-center">
        <a-input  v-model="keyword" placeholder="搜索" autocomplete="off" />
        <a-button  type="primary" class="t-serch" @click="search">搜索</a-button>
      </div>
        <div class="rules-item">
          <div class="mod-other" v-for="(item, index) in list" :key="index" @click="toDetail(item)">
            <div class="mod-left">
              <span class="circel"></span>
              <span class="title">{{item.title}}</span>
            </div>
            <div class="mod-right">
              <a  @click.stop="down(item.realPath)" class="down">下载</a>
              <span class="time">{{item.time}}</span>
            </div>
          </div>
          <a-pagination class="xh-pager" :pageSize="pageSize" @change="changePage" v-model="current" :total="total" show-less-items />
        </div>
      </section>
    </section>
  </main>
</template>
<script>
// import acMenu from './menu'
export default {
  data () {
    return {
      currentIndex: 0,
      list: [],
      keyword: '',
      form: this.$form.createForm(this),
      current: 1,
      total: 0,
      pageSize: 10
    }
  },
  components: {
    // acMenu
  },
  computed: {
  },
  created () {
    this.getArticles()
  },
  methods: {
    toDetail (item) {
      this.$router.push({ path: `/fold/${item.id}` })
    },
    search () {
      this.current = 1
      this.getArticles()
    },
    changePage (page, size) {
      this.current = page
      this.getArticles()
    },
    getArticles () {
      this.$http.downArtZone({ searchKey: this.keyword }, this.current, this.pageSize).then(res => {
        res.data.list.forEach(v => {
          v.realPath = `${process.env.VUE_APP_SRC}${v.realPath}`
        })
        this.total = res.data.total
        this.list = res.data.list
      })
    },
    down (url) {
      if (url) {
        window.location.href = url
      }
    },
    selectNav (index) {
    }
  }
}
</script>
<style lang="scss">
</style>
